﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentValidation;
using Huirui.Cavan.Domain.MainBoundedContext.Resources;

namespace Huirui.Cavan.Domain.MainBoundedContext.SystemModule.Validator
{
    public class AccountValidator : AbstractValidator<Account>
    {
        public AccountValidator()
        {
            RuleFor(d => d.Id).NotEmpty().WithMessage(Messages.Validate_IdNotEmpty);
            RuleFor(d => d.Name).NotEmpty().WithMessage(Messages.Validate_NameNotEmpty);
            RuleFor(d => d.Currency).NotEmpty().WithMessage("币别不可为空");
            RuleFor(d => d.Corporation).NotNull().WithMessage(Messages.Validate_CorporationNotNull);
        }
    }
}
